UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'INZeEKnMUtb4R3+XEdeibR1XEW2PMDYYsw7XRMenzjk=' 
WHERE 
  key_id = '164f8be605e26512682417fcc08f1b1db0db59ca4f2523f318d84b3fa21a138c' 
  AND (
    token = 'INZeEKnMUtb4R3+XEdeibR1XEW2PMDYYsw7XRMenzjk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035