UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JVIRZGHUu1NSEaZsAJ04S/YGZFuXy2kQt+zxgl6L7EI=' 
WHERE 
  key_id = 'c44c5494f9d80967396eeb8f26eff23b9d611778e5c98cb2b9db036486031d74' 
  AND (
    token = 'JVIRZGHUu1NSEaZsAJ04S/YGZFuXy2kQt+zxgl6L7EI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034