UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WwW3dMgwpmCeVmWhSkIrQpXJMvQUZnx8j7STovJWSvs=' 
WHERE 
  key_id = 'fa700830e41284d0c29a449ae6fee11cce5c033d36d3d63a269cc0f190b6737a' 
  AND (
    token = 'WwW3dMgwpmCeVmWhSkIrQpXJMvQUZnx8j7STovJWSvs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036