UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YT4U+d4yYks5/ZIv8OXnH6jqOiI57+EgYWGhR7aEoCo='
WHERE
key_id = '52556af939ba0c05b21ee60b5c700ea5d98206bc540a3fc60fdbc353b7b0002b'
AND (
token = 'YT4U+d4yYks5/ZIv8OXnH6jqOiI57+EgYWGhR7aEoCo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)