UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rKhNIK/o6AZt5KTJzHArQ46sVG9fh4o9zLsbpQR44Zs=' 
WHERE 
  key_id = '059e2eefd6f1c5b3796bf8547f41fc826480bea3abc2ed9f90458f0229a78045' 
  AND (
    token = 'rKhNIK/o6AZt5KTJzHArQ46sVG9fh4o9zLsbpQR44Zs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032