UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kFmHJ9rKdj+Eh1CM6ZN4e/RM6Lgwl4LHhF9mRslrLR0=' 
WHERE 
  key_id = '7662623181cd4dfa2f738f18b3f5a7b71bb272bb3517436b7c1e03aa372d7d26' 
  AND (
    token = 'kFmHJ9rKdj+Eh1CM6ZN4e/RM6Lgwl4LHhF9mRslrLR0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023