UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2a2Rw/DYFtULc20/s2m56VXmdlcMUsWezonmZ2eLzmk='
WHERE
key_id = 'cdb4d39f2b0e3d4470b974a9a301f53244a94f55721e9fbbd1abc831f61c06e1'
AND (
token = '2a2Rw/DYFtULc20/s2m56VXmdlcMUsWezonmZ2eLzmk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)