UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'buiyVwLydSRTFNae90AQKLwLzcUWgTkqncQd9kjzodA=' 
WHERE 
  key_id = '37ec28a4d8101b12b770338e6bd4cda93121d88e5b8855a28b4728575b6b0545' 
  AND (
    token = 'buiyVwLydSRTFNae90AQKLwLzcUWgTkqncQd9kjzodA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025