UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'o7we4DtS0zywYVDHPQJ0KmsEAOh42VjCnu+mygrdmDU='
WHERE
key_id = '5565ec3319182768877f7936a107eb09bfb0d120d227d6b9a16e37a175d83492'
AND (
token = 'o7we4DtS0zywYVDHPQJ0KmsEAOh42VjCnu+mygrdmDU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)