UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'O/enaTgFw23FbVAQy/rOoDSWK2ikgCAM7SPvkdnnDIw='
WHERE
key_id = '874fb9e798b76ac6d0838baacc2f941e9d1689bf5def56e4c5f3d1e3072c6c1e'
AND (
token = 'O/enaTgFw23FbVAQy/rOoDSWK2ikgCAM7SPvkdnnDIw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)