UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4LuXVdKLTgbOOf3w+AvK7DmA8H7lUQ4qWCtcejluHnc='
WHERE
key_id = '48be227d642b582381aaa0b08e4f292345b6bd9e9bcfd4bcca892df7d53ed994'
AND (
token = '4LuXVdKLTgbOOf3w+AvK7DmA8H7lUQ4qWCtcejluHnc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)