UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XRc0Qqww69I6/tABYFFsHncAc0hOfYp/nRrvu1uISH8='
WHERE
key_id = 'cb26811fcbe3701865ccc0fe709f93bebb5e2f1a4f79b54ea43132b5b3e159b8'
AND (
token = 'XRc0Qqww69I6/tABYFFsHncAc0hOfYp/nRrvu1uISH8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)