UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZyUhQo1w3eUyKLiEY5zyFn1poVMo7x3FLcW/Mh+bcS4=' 
WHERE 
  key_id = 'eb665a922e87556d42bdab3d2b2451b5d73cdf1cba6c83511ef7594362519113' 
  AND (
    token = 'ZyUhQo1w3eUyKLiEY5zyFn1poVMo7x3FLcW/Mh+bcS4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047