UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fshI0cF5BsYZQspyJ4VetNLZaLpY1/OzFu1CMl+5lUo='
WHERE
key_id = 'eef1a7bc3d5bb35ae5b416c53cf2d778c1553c6bfa2fcc4f4c15c82b493e6e3b'
AND (
token = 'fshI0cF5BsYZQspyJ4VetNLZaLpY1/OzFu1CMl+5lUo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)