UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'g/JzyIBOUE1D3FTFVjTvj9mu8Rh7ybQE2OkJ9xK3W04='
WHERE
key_id = '6d2e8f8625328b5ef8d5b02c9059bb545a51ea9f1f0dc55bf102794c987d2eb6'
AND (
token = 'g/JzyIBOUE1D3FTFVjTvj9mu8Rh7ybQE2OkJ9xK3W04='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)