UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '972kDsKZeZ+hOM9UXYxpouJWxEYQYdiaUeR3CNkd1Ho=' 
WHERE 
  key_id = '81a81f9d41ebd4401fda4559e7626030e459822108037956a75fa6d0277b78af' 
  AND (
    token = '972kDsKZeZ+hOM9UXYxpouJWxEYQYdiaUeR3CNkd1Ho=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046