UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'alnd3N+Cge2G44JaC4oY6z58jzIjkZxftxVSlLLIGsQ='
WHERE
key_id = '27a8435f34767abed1a8b4f05bb3813395d3fc49b49fe76139f8c2d4a6bcb3e6'
AND (
token = 'alnd3N+Cge2G44JaC4oY6z58jzIjkZxftxVSlLLIGsQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)