UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'U0PTIGCItO07uz6QRhzgXaKyIg6CFlrGJX6L3qYlWKs='
WHERE
key_id = 'b9be71867ddd375b6013cc0f79dc865c6058acfc748bd10cbc4928eca84b2f05'
AND (
token = 'U0PTIGCItO07uz6QRhzgXaKyIg6CFlrGJX6L3qYlWKs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)