UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rg992R2N3/PjOaGVJYBU1HYK22sRcgbqEtNJlgc03rU='
WHERE
key_id = 'a150f1300a52a107cc5fa8ac04ffb48ea53daae256cc3c87bf70c28546e544f7'
AND (
token = 'rg992R2N3/PjOaGVJYBU1HYK22sRcgbqEtNJlgc03rU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)