UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rJqg9438pPh4QvfDRbHLpRLNqgZU5HFZibtU4dDq/Vw='
WHERE
key_id = 'a03ee2f01ac3290c1cd98de371e3b1a962392d78a9d28cde388524a4f0132e8a'
AND (
token = 'rJqg9438pPh4QvfDRbHLpRLNqgZU5HFZibtU4dDq/Vw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)