UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yxNwKOTwmIy4HTxyqV4GTP1oh4KdiHxAldeBwHYHWEo=' 
WHERE 
  key_id = '43d015a2f1728010dcfb0f55b3e22aeb68122931e3a89fd87749d9799b18b62c' 
  AND (
    token = 'yxNwKOTwmIy4HTxyqV4GTP1oh4KdiHxAldeBwHYHWEo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024