UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+16XlpW1ZAST4n783MZHDPV5jqM6+JmlR2XceKosaBM=' 
WHERE 
  key_id = '703debb3cbb730e4bad1f180824a3ea967dc27748d3488045090da7670f519f9' 
  AND (
    token = '+16XlpW1ZAST4n783MZHDPV5jqM6+JmlR2XceKosaBM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044