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