UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IsL4ycRdIfdfG6dNWdyb/8P8yTgDzjw+YlzH2O8R4yw=' 
WHERE 
  key_id = 'fdaf6a534add9a94c20b43513196f0d64375443c9205b2d8e4130bae69a6d685' 
  AND (
    token = 'IsL4ycRdIfdfG6dNWdyb/8P8yTgDzjw+YlzH2O8R4yw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028