UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Gas7Zj0O1TIYJjTcPIggzBjPmg1G9lTUSJTG87/jT3Q='
WHERE
key_id = 'a33194e9912d7fdedfbac4b5c310a9659e5237c3fd3b88eaf95bdf51c46a3e4e'
AND (
token = 'Gas7Zj0O1TIYJjTcPIggzBjPmg1G9lTUSJTG87/jT3Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)