UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'o+G1ozfEVtauHYxcjC8BWBghfSaTXJNMRLwYmJWGI2o='
WHERE
key_id = '2d93e7d9ef83ed1bbc5ed8dd3348f761e901d948503ab7e3df852bf8ead505ca'
AND (
token = 'o+G1ozfEVtauHYxcjC8BWBghfSaTXJNMRLwYmJWGI2o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)