UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fdulLZwmb1GNqYE0KWTiaFpcMmeAPhMYKwsqWQwR46A='
WHERE
key_id = '0e4ea50e932ea42e4f0001ba706b69791ef3ab32d4c11aa6287bca721acdfe23'
AND (
token = 'fdulLZwmb1GNqYE0KWTiaFpcMmeAPhMYKwsqWQwR46A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)