UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lMMHJobPrsHmteGZlt9j92e1hr9AWWJVv5euBh9I+nU='
WHERE
key_id = 'f36a8e366f98fb6208271aaab08e7d9204fcc89a955d9b4a3b8fd01ce18a96f7'
AND (
token = 'lMMHJobPrsHmteGZlt9j92e1hr9AWWJVv5euBh9I+nU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)