UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8tU+RF4TCmsBnxg7K5XA3xlAPyRwYKhJOdaRYLUmU98='
WHERE
key_id = '34a3bfaecd69f8d3a21469f4463af631867c820f24bbe83dcf6bce86711f011f'
AND (
token = '8tU+RF4TCmsBnxg7K5XA3xlAPyRwYKhJOdaRYLUmU98='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)