UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/E3IkilVB3ZTku7B2eRNRoecD3aaOz+xhaiwNpbLXNo=' 
WHERE 
  key_id = '2c29324160ea5e15ed12a0f6cc1a338566e3c614fc54b879866c327cd278a314' 
  AND (
    token = '/E3IkilVB3ZTku7B2eRNRoecD3aaOz+xhaiwNpbLXNo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033