UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'y2idDvjLNsg95fuEPuzdwyG0PFSPUYPfhcGA078crSg='
WHERE
key_id = '80637022593932f20030b35bb93f9933484cc9acbdc392ecef1909408d5d1dea'
AND (
token = 'y2idDvjLNsg95fuEPuzdwyG0PFSPUYPfhcGA078crSg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)