UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cVCYscPRwswfNB5dAdk6il9cMRy9rKa9gqDyCzHd+cA=' 
WHERE 
  key_id = '89b435efdf543aa4071a6c1aa456e92772ee9935b60133429c5944da3e5af3b4' 
  AND (
    token = 'cVCYscPRwswfNB5dAdk6il9cMRy9rKa9gqDyCzHd+cA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042