UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '15uLnGKGelFJvWOCzla1/YdSxZFqeaKoXx+JW3Jvdr4=' 
WHERE 
  key_id = '2b20c893cf93cb4dafa246a0b26c658c6ebf7df5ed6486cf6eb81c02a1885539' 
  AND (
    token = '15uLnGKGelFJvWOCzla1/YdSxZFqeaKoXx+JW3Jvdr4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035