UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6HOkDLC4zDF6SKWPCU8VHh4Aj2x8xuhLz13M5romVn0=' 
WHERE 
  key_id = 'f3af5c9669de389d83428bad47fe12e528c6f74958d83586ffec368964bcf100' 
  AND (
    token = '6HOkDLC4zDF6SKWPCU8VHh4Aj2x8xuhLz13M5romVn0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016