UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7421jZrio+/XnN8MeeoOeqUBLJEiH9ruWBrvvWdl97E='
WHERE
key_id = 'e7a937c9d30bf01e66d54b58606886568022cd68a0adc6adea03860a4aac4380'
AND (
token = '7421jZrio+/XnN8MeeoOeqUBLJEiH9ruWBrvvWdl97E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)