UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4zIXJ95U3H96UyNR6q92Sno/QQkFdw7jGiPAshyGIZw='
WHERE
key_id = 'fde078e6681198f5f73fd1186a2096f14f392da7267f57778f912d7e4831401c'
AND (
token = '4zIXJ95U3H96UyNR6q92Sno/QQkFdw7jGiPAshyGIZw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)