UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LgzbQGJof5LRnqvRN+ZbGGyClwhybvHudiBSNKqRUVE='
WHERE
key_id = 'f43a961f09045c5a839fb7b3ce58fd1444638305f4940e6c005924889d17c8ab'
AND (
token = 'LgzbQGJof5LRnqvRN+ZbGGyClwhybvHudiBSNKqRUVE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)