UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'j5Rp/hRwGC50WMIRkTiWfVShhHHzCR56pVdnjyydgaY=' 
WHERE 
  key_id = '6f370168c53abeb592da1820dbece31abe71c131485658122f18590a48025e04' 
  AND (
    token = 'j5Rp/hRwGC50WMIRkTiWfVShhHHzCR56pVdnjyydgaY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029