UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ls+3o3onx1H/rE7VWKWVaV1b9dmtpa39SQrM8dPSVe0=' 
WHERE 
  key_id = '60d189b814cef1e32c0dc6fa314a5f1bb3d38329b3b03db2f544fc596a82920b' 
  AND (
    token = 'Ls+3o3onx1H/rE7VWKWVaV1b9dmtpa39SQrM8dPSVe0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026