UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+2sGH2DcD9DSCTOn3Yv7z5n0Rt+F1S7UjD6OCmeb270=' 
WHERE 
  key_id = '247d11cb09c3b9811ae862ce7c63515d3d3e7c24cf8b77aab374e77a182d3890' 
  AND (
    token = '+2sGH2DcD9DSCTOn3Yv7z5n0Rt+F1S7UjD6OCmeb270=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021