UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UmIxsofMAfr6/qi77JM8e9ei0Mc7UQZb+Wxwa03NwAY='
WHERE
key_id = 'e6244d0c1e1e22396d48352410774ee28abbe8d738ffca286ca47a16df832b9b'
AND (
token = 'UmIxsofMAfr6/qi77JM8e9ei0Mc7UQZb+Wxwa03NwAY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)