UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/rgleEqFuT9Ayq1siftfQZqPyUucF95BIHeqh+KNk2g='
WHERE
key_id = 'a49b0283ac817f5585876dd431547af84b7ee2412febc3e7ac0cec0d71479e87'
AND (
token = '/rgleEqFuT9Ayq1siftfQZqPyUucF95BIHeqh+KNk2g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)