UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'U8xoegUTe/fZdMXqJZe1rkExfhXjBENGqcGh8jElB8o=' 
WHERE 
  key_id = '4532b5a885c4e128023f18d10f96d55651b6b132881149dbf33568d3f057c516' 
  AND (
    token = 'U8xoegUTe/fZdMXqJZe1rkExfhXjBENGqcGh8jElB8o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035