UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nsCpjsOrACDGsqRd47rSPELCImgc1sL8qHH4w9wzPvE=' 
WHERE 
  key_id = '882b2ce201988fa39a64299b97732092c3ec3608bde960faeb062785a5e8d7d4' 
  AND (
    token = 'nsCpjsOrACDGsqRd47rSPELCImgc1sL8qHH4w9wzPvE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055