UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nSoOYxvckyF3Ogkt6TDY0gN484nsb6Dwgh9IMbJeVHI=' 
WHERE 
  key_id = 'ac21e4a22b15cbf895f6069e1606f622897061548f31c9ef1b2126bbdd648c35' 
  AND (
    token = 'nSoOYxvckyF3Ogkt6TDY0gN484nsb6Dwgh9IMbJeVHI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051