UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NvOjCMq3rPeoURGGG6wJnV+6+VtUrP1A0zNz6KGUi2w='
WHERE
key_id = '611307b6bf8aa10c65cd77b58baf75af0a81db471681b4df4fafeb7a5b6da976'
AND (
token = 'NvOjCMq3rPeoURGGG6wJnV+6+VtUrP1A0zNz6KGUi2w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)