UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WgsQFheHdOFufaSnGosu6TJNbEMsRrnkDL+SUDzzAwM='
WHERE
key_id = '018acb1a5280167c5bdec9cc5f68f4298986a1480728ed9e9ef14861d0ce4eb1'
AND (
token = 'WgsQFheHdOFufaSnGosu6TJNbEMsRrnkDL+SUDzzAwM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)