UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yURZhG2s6Z1xeFBSr83IunDOoT8LfkEyCVgp+IX5afQ='
WHERE
key_id = 'cfed1cb57e2a376bc3f7ce365b9fa55d220080e516a006900d88cafcc8d55e33'
AND (
token = 'yURZhG2s6Z1xeFBSr83IunDOoT8LfkEyCVgp+IX5afQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)