UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'axP+G59OrJcg2q19yFXWWp2WBaNUA6qGufSN3LCkPn0='
WHERE
key_id = 'a083492389c733193dd210c5967641b1413195ef08837b2e93ae28b3ed315ca8'
AND (
token = 'axP+G59OrJcg2q19yFXWWp2WBaNUA6qGufSN3LCkPn0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)