UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '44HypbM/sjW+XzLNV78L8L1cT2AaRYbdFGgdGBNEqig=' 
WHERE 
  key_id = '844cedfe85e2c58d583f0c9259dc4a666d660b0db8c7e927901093aaa0bf0b8b' 
  AND (
    token = '44HypbM/sjW+XzLNV78L8L1cT2AaRYbdFGgdGBNEqig=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035